function soNumero(evt)
   {
      var charCode = (evt.which) ? evt.which : event.keyCode;
      if (charCode != 8 && charCode !=13
        && (charCode < 48 || charCode > 57))
         return false;

      return true;
   }
 
  function mascaraTelefone( campo ) {
       
         function trata( valor,  isOnBlur ) {
             
            valor = valor.replace(/\D/g,"");     
             
            if( isOnBlur ) {
                
               valor = valor.replace(/(\d)(\d{4})$/,"$1-$2");  
            } 
            return valor;
         }
          
        campo.onblur = function() {
             
            var valor = this.value;
            if((valor.length < 8)||((valor.length <= 8 ) && (valor.indexOf("-")!== -1))){
               this.value = "";
               alert("Formato de telefone invalido!");
            }else {      
               this.value = trata( this.value, true );
            }
         }
         
         campo.maxLength = 9;
      }





          
        